﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Enterprise.Migrations
{
    public partial class 数据库变更 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "VISIT_ID",
                table: "PATIENT_PARTING_INFO",
                type: "VARCHAR(20)",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "INT");

            migrationBuilder.AlterColumn<string>(
                name: "PATIENT_ID",
                table: "PATIENT_PARTING_INFO",
                type: "VARCHAR(20)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "VARCHAR(10)",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "LABEL_TYPE_NAME",
                table: "HCD_PAT_LABELS",
                type: "VARCHAR(20)",
                nullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "VISIT_ID",
                table: "HCD_MESSAGE",
                type: "VARCHAR(20)",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "INT");

            migrationBuilder.AlterColumn<string>(
                name: "PATIENT_ID",
                table: "HCD_MESSAGE",
                type: "VARCHAR(20)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "VARCHAR(10)",
                oldNullable: true);

            migrationBuilder.AlterColumn<DateTime>(
                name: "REMOVE_DATE_TIME",
                table: "HCD_MASTER",
                type: "DATETIME",
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "DATETIME");

            migrationBuilder.AlterColumn<DateTime>(
                name: "DISCHARGE_DATE_TIME",
                table: "HCD_MASTER",
                type: "DATETIME",
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "DATETIME");

            migrationBuilder.AddColumn<string>(
                name: "PARTING_CODE",
                table: "HCD_MASTER",
                type: "VARCHAR(20)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PARTING_NAME",
                table: "HCD_MASTER",
                type: "VARCHAR(20)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PATIENT_ID",
                table: "HCD_MASTER",
                type: "VARCHAR(20)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "VISIT_ID",
                table: "HCD_MASTER",
                type: "VARCHAR(20)",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "LABEL_TYPE_NAME",
                table: "HCD_PAT_LABELS");

            migrationBuilder.DropColumn(
                name: "PARTING_CODE",
                table: "HCD_MASTER");

            migrationBuilder.DropColumn(
                name: "PARTING_NAME",
                table: "HCD_MASTER");

            migrationBuilder.DropColumn(
                name: "PATIENT_ID",
                table: "HCD_MASTER");

            migrationBuilder.DropColumn(
                name: "VISIT_ID",
                table: "HCD_MASTER");

            migrationBuilder.AlterColumn<int>(
                name: "VISIT_ID",
                table: "PATIENT_PARTING_INFO",
                type: "INT",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "PATIENT_ID",
                table: "PATIENT_PARTING_INFO",
                type: "VARCHAR(10)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)",
                oldNullable: true);

            migrationBuilder.AlterColumn<int>(
                name: "VISIT_ID",
                table: "HCD_MESSAGE",
                type: "INT",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "PATIENT_ID",
                table: "HCD_MESSAGE",
                type: "VARCHAR(10)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)",
                oldNullable: true);

            migrationBuilder.AlterColumn<DateTime>(
                name: "REMOVE_DATE_TIME",
                table: "HCD_MASTER",
                type: "DATETIME",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "DATETIME",
                oldNullable: true);

            migrationBuilder.AlterColumn<DateTime>(
                name: "DISCHARGE_DATE_TIME",
                table: "HCD_MASTER",
                type: "DATETIME",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "DATETIME",
                oldNullable: true);
        }
    }
}
